<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<link rel="stylesheet" href="/css/bootstrap.min.css" />
<!--bootstrap图片上传插件  -->
<link href="/fileinput/fileinput.min.css" rel="stylesheet">
<!--风格css框架  -->
<link href="/fileinput/theme.css" rel="stylesheet">
<!--图标字体框架  -->
<link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
<link href="/css/layui.css" rel="stylesheet">
<style>
.kv-avatar .krajee-default.file-preview-frame, .kv-avatar .krajee-default.file-preview-frame:hover
	{
	margin: 0;
	padding: 0;
	border: none;
	box-shadow: none;
	text-align: center;
}

.kv-avatar {
	display: inline-block;
}

.kv-avatar .file-input {
	display: table-cell;
	width: 213px;
}

.kv-reqd {
	color: red;
	font-family: monospace;
	font-weight: normal;
}
</style>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<input id="id" name="id" th:value="${tbMedia.id}" type="hidden">
							<div class="form-group">
								<label class="col-sm-3 control-label">视频名称：</label>
								<div class="col-sm-8">
									<input id="title" name="title" th:value="${tbMedia.title}"
										class="form-control" type="text">
								</div>
							</div>
							<input type="hidden" id="picture" name="picture" th:value="${tbMedia.picture}">
							<div class="form-group">
								<label class="col-sm-3 control-label">视频存放地址：</label>
								<div class="col-sm-8">
									<input id="src" name="src" th:value="${tbMedia.src}"
										class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">视频展示图：</label>
								<div class="col-sm-8">
									<div class="kv-avatar">
										<div class="file-loading">
											<input id="img" name="img" type="file">
										</div>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">视频描述：</label>
								<div class="col-sm-8">
									<input id="descript" name="descript"
										th:value="${tbMedia.descript}" class="form-control"
										type="text">
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 全局js -->
	<script src="/js/jquery.min.js?v=2.1.4"></script>
	<script src="/js/bootstrap.min.js?v=3.3.6"></script>
	<script type="text/javascript" src="/fileinput/fileinput.min.js"></script>
	<!--bootstrap图片上传插件  -->
	<script type="text/javascript" src="/fileinput/theme.js"></script>
	<!--风格  -->
	<script type="text/javascript" src="/fileinput/zh.js"></script>
	<script src="/js/plugins/validate/jquery.validate.min.js"></script>
	<!--汉化  -->
	<script src="/js/plugins/layer/layer.js"></script>
	<!--layer弹框js  -->
	<script type="text/javascript" src="/js/appjs/loa/tbMedia/edit.js"></script>
	<script th:inline="javascript">
		$("#img").fileinput({
			language: "zh",  //国际化
	        theme: 'fa',  //显示主题
			uploadAsync: true, //是否允许异步上传
			enctype: 'multipart/form-data',
		    uploadUrl: '/mv/io/editLogo/?id='+[[${tbMedia.id}]]+'', // 上传的地址
		    overwriteInitial: true,
		    showUpload: true, //是否显示上传按钮
		    maxFileSize: 2048,
		    layoutTemplates :{
	            // actionDelete:'', //去除上传预览的缩略图中的删除图标
	            actionUpload:'',//去除上传预览缩略图中的上传图片；
	            //actionZoom:''   //去除上传预览缩略图中的查看详情预览的缩略图标。
	        },
		    showClose: false,
		    showCaption: false,
		    showBrowse: false,
		    browseOnZoneClick: true,
		    removeLabel: '',
		    removeIcon: '<i class="glyphicon glyphicon-remove"></i>',
		    removeTitle: '取消或重置更改',
		    elErrorContainer: '#kv-avatar-errors-2',
		    msgErrorClass: 'alert alert-block alert-danger',
		    defaultPreviewContent: '<img src="'+[[${tbMedia.picture}]]+'" alt="Your Avatar"><h6 class="text-muted">点击这里修改<上传图片不能超过2M></h6>',
		    allowedFileExtensions: ["jpg", "png", "gif"]
		}).on("fileuploaded", function(event, data) {
			if(data.response.code == 0){
				document.getElementById("picture").value = data.response.msg
			}else{
				parent.layer.msg(data.response.msg);
			}    
	    });
</script>
</body>
</html>
